Repository navigation
fix(fleet): quiet exit on broken pipe — SIGPIPE default + EPIPE-safe secrets output (#5569) - #6225
Merged
Merged
Conversation
…PE-safe secrets output (#5569)
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 41 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #5569 —
fleet secrets list | headpanicked withfailed printing to stdout: Broken pipewhen the downstream pipe closed early.What changed
crates/fleet/src/main.rs— restore the default SIGPIPE disposition at startup (restore_default_sigpipe, unix only). The Rust runtime ignores SIGPIPE, so aprintln!in any domain panics on EPIPE. With the default disposition the process dies quietly by SIGPIPE, like a well-behaved Unix filter, whichever verb is printing. This is the shared-path fix: the audit found no shared print helper — queue, search, and secrets each print independently — so the shared entry point is where the class is fixed.crates/fleet/src/secrets.rs—secrets listandsecrets getnow write through a locked stdout withwriteln!, classifying the outcome viawrite_line: BrokenPipe → quietEXIT_OK; any other write error stays loud (EXIT_UNRESOLVED+ stderr). Only EPIPE gets the quiet path — genuine write errors are not masked.Cargo.toml/Cargo.lock—libcas a unix-only direct dependency of thefleetbin (already in the lockfile as a transitive dep) for the disposition reset.Tests (oracle: writer outcomes + the binary's pipe behaviour)
secrets.rswith a failing-writer oracle: BrokenPipe maps to the quiet outcome, other errors (StorageFull) stay loud, and a successful write is byte-exact.cargo test -p fleet --bin fleet: 13 passed, 0 failed (laptop).fleet --help | head -1× 30 — 0 panics (pre-fix this class panicked viaprintln!; triage task 10082 reproduced the panic onsecrets listitself, 1-in-10 racy).cargo fmt --checkclean. Localcargo clippycould not run to completion on the laptop due to a pre-existing stale-target toolchain skew (E0514 in untouched cratesfleet-config/fleet-proxy-proto); CI's fresh clippy run is the check for that.Audit note (acceptance: other list-shaped verbs)
Queue and search do not share the secrets print path (verified: independent
println!sites infleet-queue/fleet-search), so they did not share this exact defect path; the SIGPIPE disposition reset inmain()covers their early-close behaviour when run through thefleetbinary.Queue task 10517 (lane code-c), follow-up to triage task 10082.
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.